<template>
  <div class="search">
    <f-form ref="form" :action="api.bank.saveOrUpdate" :form-key="this.formItem.bankId" style="width: 60%">
      <f-form-item label="开户行" name="bankName" :required="true" :value="formItem.bankName" />
      <f-form-item label="开户账户" name="bankNo" :required="true" :value="formItem.bankNo"/>
      <f-form-item label="开户人" name="bankOwner" :required="true" :value="formItem.bankOwner"/>
      <f-form-item label="开户行地址" name="bankAddress" :required="true" :value="formItem.bankAddress"/>
    </f-form>
    <div style="padding-left: 100px">
      <a-button type="primary" @click="handleSubmit" :loading="saving">保存</a-button>
    </div>
  </div>
</template>

<script>

  export default {
    name: 'BankInfo',
    props: {},
    data() {
      return {
        isAdd: true,
        loaded: false,
        areaIds: [],
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          bankId: '',
          bankName: '',
          bankNo: '',
          bankOwner: '',
          bankAddress: ''
        }
      },
      setData(userInfo) {
        this.$refs.form.resetFields()
        this.http.get(this, {
          url: this.api.bank.get,
          params: {
            bankId: userInfo.companyId
          },
          success: function(me, data) {
            me.loaded = true
            me.formItem = data
          }
        })
      },
      handleSubmit() {
        this.$refs.form.handlerSubmit({})
      }
    },
    created() {

    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
